Re: [SQL] Using Update - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] Using Update
Date
Msg-id l03130303b39cec11db6a@[147.233.159.109]
Whole thread Raw
In response to Using Update  (Christian Rudow <Christian.Rudow@thinx.ch>)
Responses Re: [SQL] Using Update
List pgsql-sql
At 11:27 +0300 on 28/06/1999, Christian Rudow wrote:


> I just seem to use the UPDATE not correctly, it cannot be parsed.
> What is the correct solution to this ?
> Can anyone help ?
>
> I know that's a RTFM but I have no FM to R.
> Is there a good SQL tutorial/reference accessible over the net ?

The usual FM is recommended. That is, the PostgreSQL user guide, which
comes with the software, if you compile it from source. Can't guarantee
that it comes with rpms. You can also man (postgres comes with manpages).
And you can also do a "\h update" in psql, to get the bare-bones syntax.

>From the manpage:

SYNOPSIS    update classname set attname-1 = expression-1         [, attname-i = expression-i]         [from from-list]
       [where qual]
 


So, it appears that the correct syntax in Postgres would be:

UPDATE b
SET b.a_id = a.aid
FROM a
WHERE b.custno = a.custno;

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




pgsql-sql by date:

Previous
From: Christian Rudow
Date:
Subject: Using Update
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: [SQL] Using Update